package com.netbliz.ftpmanagment.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.HashMap;
import java.util.Map;

public class Test {
	public static void main(String[] args) {
//		Connection conn = null;                          //建立数据库连接对象
//	    PreparedStatement stmt = null;                       //建立数据库操作对象
//	    try{                                                 //使用try-catch捕捉异常
//	     Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");        //加载JDBC-ODBC桥驱动程序
//	     conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1500;databasename=serv-u;user=serv-u;password=serv-u"); //连接ODBC数据源
//	     stmt = conn.prepareStatement("select count(*)as num from dbo.ftp_sys_users");
////	     stmt.setString(1,name);
////	     stmt.setString(2,password);
////	     stmt.setString(3,sex);
////	     stmt.setString(4,work);
////	     //stmt.setString(5,strLove);
////	     stmt.setString(5,show);
//	     //stmt.execute();
//	     ResultSet result = stmt.executeQuery();
//	     while(result.next()){
//	    	 System.out.println(result.getInt("num"));
//	     }
//
//	     //System.out.println(stmt.executeQuery());
//	    }catch(Exception e){
//	     e.printStackTrace();
//	    }
//	    System.out.println("sfdsfsdfss");
//	    
		EAbsTest eAbsTest1=EAbsTest.getInstance();
		eAbsTest1.map.put("hello","sdf");
		System.out.println("eAbsTest1"+eAbsTest1.map.size());
		EAbsTest eAbsTest2=EAbsTest.getInstance();
		//eAbsTest1.string="hello";
		System.out.println("eAbsTest2"+eAbsTest2.map.size());
	}
}
abstract class AbsTest{
	protected Map<String, String> map=new HashMap<String, String>();

}
class EAbsTest extends AbsTest{
	private static EAbsTest eAbsTest=null;
	private EAbsTest(){
		
	}
	public static EAbsTest getInstance(){
		if(null==eAbsTest){
			eAbsTest=new EAbsTest();
		}
		return eAbsTest;
	}
}
